/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package origendatos.dyd.model;

import java.io.Serializable;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author erodrig
 */
@Entity
@Table(name = "DOTES_PJ")
@NamedQueries({
    @NamedQuery(name = "DotesPj.findAll", query = "SELECT d FROM DotesPj d"),
    @NamedQuery(name = "DotesPj.findByNombre", query = "SELECT d FROM DotesPj d WHERE d.dotesPjPK.nombre = :nombre"),
    @NamedQuery(name = "DotesPj.findByPjId", query = "SELECT d FROM DotesPj d WHERE d.dotesPjPK.pjId = :pjId")})
public class DotesPj implements Serializable {
    private static final long serialVersionUID = 1L;
    @EmbeddedId
    protected DotesPjPK dotesPjPK;

    public DotesPj() {
    }

    public DotesPj(DotesPjPK dotesPjPK) {
        this.dotesPjPK = dotesPjPK;
    }

    public DotesPj(String nombre, int pjId) {
        this.dotesPjPK = new DotesPjPK(nombre, pjId);
    }

    public DotesPjPK getDotesPjPK() {
        return dotesPjPK;
    }

    public void setDotesPjPK(DotesPjPK dotesPjPK) {
        this.dotesPjPK = dotesPjPK;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (dotesPjPK != null ? dotesPjPK.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DotesPj)) {
            return false;
        }
        DotesPj other = (DotesPj) object;
        if ((this.dotesPjPK == null && other.dotesPjPK != null) || (this.dotesPjPK != null && !this.dotesPjPK.equals(other.dotesPjPK))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "origendatos.dyd.model.DotesPj[dotesPjPK=" + dotesPjPK + "]";
    }

}
